home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-06 | 3.8 KB | 69 lines | [TEXT/GEOL] |
- Item 4724824 5-Oct-90 06:04PDT
-
- From: D4727 Philmont SW Mill, Jesse Feiler,PAS
-
- To: MACAPP.TECH$ MacApp Technical
-
- Sub: InsideOut/TDocument/MacApp.
-
- I (sort of) agree with Jeff that the documentness as a runtime concept should
- be divorced (a lot) from disk icons and the disk files that lurk beneath them.
- That's why I still believe that the database should NOT be a descendant of
- TDocument.
-
- The point about shared databases/which app. to open is valid, but a practical
- solution is not difficult. Double-clicking on a database icon should open one
- application that is more significant than others with regard to the database:
- generally this would be a browser or possibly a housekeeping app. After all if
- you want to muck around with the database, those are the tools you'd use. If
- you want to do Accounts Payable, you'd double-click the A/P icon. I don't see
- this as a major problem.
-
- The main reason for NOT letting the database descend from TDocument is really
- defensive programming. If we look at much of the TDocument functionality --
- printing, saving, displaying in window(s), etc., these functions really don't
- apply to a database as a whole, particularly larger, multi-user databases. I
- have (almost) never worked on an application where we allowed more than one
- saveable entity (which in practical terms is usually one record in a database
- view) to be open for editing at a time: you simply can't do that in a multiuser
- database without causing horrible problems. The original Macintosh model of
- opening a document, reading it into memory, and then fiddling with it with fast
- sub-second response time isn't appropriate to a database.
-
- Now, you may say "what if I want to open a window which is a list of all
- customers in the database - just to review it, not to update it. What's the
- document?" My answer is it's a runtime document (in Jeff's terms) that has
- certain attributes, including the lack of save command (remember, no update).
- And in the MacApp world, it just might be a document-less TView. If you
- double-click on one customer name, you open a TWindow and TDocument which is
- that customer's view record which is saveable, printable, updateable, etc. If
- you accept that we should keep unsaved (hence locked) parts of a database to a
- minimum, I think it's worth discouraging the use of the database as a TDocument
- descendant, since people may try to implement things like "save" and "print"
- for the whole database, and these commands should be discouraged. At least in
- the large multi-user database world.
-
- Another reason for focusing on TDocuments as database views is that this design
- becomes even more important in SQL, where the database has even less importance
- than it does in InsideOut: the individual tables (views) are truly the objects
- of concern.
-
- Jeff Alger's comment of documentness being a run-time concept is very valuable,
- and becomes even more relevant when we look at the SQL world. If I say "SELECT
- City, Best-Hotel, 2-best-hotel from Michelin-guide where country = "France"" I
- should create a run-time document. That's what the user would expect. A
- window should be opened; it should be printable; and save should be available
- (although its meaning is ambiguous: do I save the query or the results of the
- query? - probably options allow save/query, save/data in spreadsheet, save/data
- as text, etc.).
-
- It seems to me that the only reason to descend a TDatabase from TDocument is to
- allow opening from the Finder. We've found that it's trivial to set up the
- appropriate bundles and override TApplication.HandleFinderRequest to create our
- TApplication.fDatabase (actually gDatabase) in our applications. In addition,
- for our descendants of TDocument - which correspond to individual records in
- InsideOut views - we simply override TDocument.Save and are home free.
-
- Jesse Feiler.
-
-